########################################################
## ~W: aPaϺXm~
## ~@: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## ~@: Nuttzy99 < n/a > (Nuttzy) http://www.spellingcow.com/
## ~@: AbelaJohnB < n/a > (John B. Abela) n/a
## ~yz: oӥ~\AU|ܩݪaPaϪXm
## ~: 2.3.2
## 
## w:  
## wˮɶ: 15 - 20  
##
## ݭns誺ɮ: 12
##	viewtopic.php
##	memberlist.php
##	admin/admin_users.php
##	includes/constants.php
##	includes/usercp_viewprofile.php
##	includes/usercp_register.php
##	includes/usercp_avatar.php
##	language/lang_chinese_traditional_taiwan/lang_main.php
##	language/lang_chinese_traditional_taiwan/lang_admin.php
##	templates/subSilver/profile_add_body.tpl
##	templates/subSilver/admin/user_edit_body.tpl
##
## [ɮ: 6 + 261 ϥ
##	root/images/flags/*.gif
##	root/admin/admin_flags.php
##	root/templates/subSilver/admin/flags_list_body.tpl
##	root/templates/subSilver/admin/flags_edit_body.tpl
##	contrib/install/db_update_en.php
##	contrib/install/db_update_en.txt
##	contrib/install/db_update_tw.php
##	contrib/install/db_update_tw.txt
##	contrib/install/db_update_cn.php
##	contrib/install/db_update_cn.txt
##
## vn: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 
################################################################# 
## ѩwWҶq, ˬd: http://www.phpbb.com/mods/
## O_~̷s. Mb[J~ƮweA~wggLˬd
## OoäOҥ~SwWD. 
## 󤣦b~Ʈw (http://www.phpbb.com/mods/) ~
## N|b phpbb.com QתO䴩 
##############################################################
## @̯d:
##	~b 2.0.21 WչL. iH EasyMOD 0.3.0 Ӧw˦~
##	XmϥܨӦ CIA - The World Factbook - Flags of the World
##	http://www.cia.gov/cia/publications/factbook/docs/flagsoftheworld.html
##
############################################################## 
## v: 
##
##   2002-02-28 -  ???
##      - sib 2.0 RC2 Ww - Nuttzy
##
##   2002-04-01 -  ???
##      - sib 2.0 RC4 Ww
##	- b|Ckmϥ
##
##   2002-04-14 -  2.0.4
##	- sib 2.0 Final Ww
##
##   2002-05-18 -  2.0.5
##	- ץFɭӤHƷ|m]w - P sj26!
##	- bsӤHƮܺXm -  sj26 
##	- iHb޲zxs|Xm
##	- sF 2.0.4 ̪{
##
##   2002-08-13 -  2.0.6
##	- sib 2.0.2 Ww
##	- siϥ EasyMod alpha
##
##   2003-02-20 -  2.2.0
##	- sib 2.0.4 Ww
##	- W[޲zxs/W[/RXm\
##
##   2006-04-15 -  2.3.0
##	- ~ ycl6 
##	- sib 2.0.20 Ww
##	- W[ha/aϩMXm
##	- ssgF{HέץF@Ǥp
##
##   2006-05-05 -  2.3.1
##	- ץFbssӤHƮɺXm|mD (P kenn)
##
##   2006-06-24 -  2.3.2
##	- W[i EastMOD Ӧw˪ SQL O
## 
############################################################## 
## bW[~e, аȥƥҦݭnק諸ɮ
##############################################################

#
#-----[ ƻs ]------------------------------------------ 
#
copy root/images/flags/*.gif to images/flags/
copy root/admin/*.php to admin/
copy root/templates/subSilver/admin/*.tpl to templates/subSilver/admin/
#
#-----[ DIY ʳ]w ]------------------------------------------ 
#
k@: ƻs root/install/db_update_tw.php  install/db_update_tw.php. åBbR
kG: ϥ contrib/install/db_update_tw.txt ̭Oʥ[JƮw
#
#-----[ } ]------------------------------------------ 
#
includes/constants.php
#
#-----[ M ]------------------------------------------ 
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
#
#-----[ , [W ]------------------------------------------ 
#
define('FLAG_TABLE', $table_prefix.'flags');	// Country/Location Flags
# 
#-----[ } ]------------------------------------------ 
# 
includes/usercp_viewprofile.php
#
#-----[ M ]------------------------------------------ 
#
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
#
#-----[ , [W ]------------------------------------------ 
#
// Country/Location Flags
$location = ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;';
$flag = ( !empty($profiledata['user_from_flag']) ) ? '&nbsp;<img src="images/flags/' . $profiledata['user_from_flag'] . '" alt="' . $profiledata['user_from_flag'] . '" title="' . $profiledata['user_from_flag'] . '" border="1" />' : '';
$location .= $flag;
#
#-----[ M ]------------------------------------------ 
#
	'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : '&nbsp;',
#
#-----[ N ]------------------------------------------ 
#
	'LOCATION' => $location,	// Country/Location Flags
# 
#-----[ } ]------------------------------------------ 
# 
includes/usercp_register.php
#
#-----[ M ]------------------------------------------ 
#
	$user_timezone = ( isset($HTTP_POST_VARS['timezone']) ) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];
#
#-----[ , [W ]------------------------------------------ 
#
	$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '' ;	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
# 
#
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql
#
#-----[ bӦ椺M ]------------------------------------------ 
#
user_from = '" . str_replace("\'", "''", $location) . "',
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 user_from_flag = '" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ M ]------------------------------------------ 
#
			$sql = "INSERT INTO " . USERS_TABLE . "	(user_id
				VALUES ($user_id
#
#-----[ bӦ椺M ]------------------------------------------ 
#
user_from,
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 user_from_flag,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
'" . str_replace("\'", "''", $location) . "',
#
#-----[ bӦ, [W ]------------------------------------------ 
#
'" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ M ]------------------------------------------ 
#
	$location = $userdata['user_from'];
#
#-----[ , [W ]------------------------------------------ 
#
	$user_flag = $userdata['user_from_flag'];	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
#
	display_avatar_gallery($mode,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
$location,
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 $user_flag,
#
#-----[ M ]------------------------------------------ 
#
		$template->assign_block_vars('switch_edit_profile', array());
	}
#
#-----[ , [W ]------------------------------------------ 
#
	// Country/Location Flags
	// Query to get the list of flags
	$sql = "SELECT *
		FROM " . FLAG_TABLE . "
		ORDER BY flag_name";
	if(!$flags_result = $db->sql_query($sql))
	{
		message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
	}

	// Build the html select statement
	$flag_start_image = 'blank.gif';
	$flag_select = '<select name="user_flag" onChange="document.images[\'user_flag\'].src = \'images/flags/\' + this.value;">';
	$flag_select .= '<option value="blank.gif">' . $lang['Select_country'] . '</option>';
	while ( $flag_row = $db->sql_fetchrow($flags_result) )
	{
		$flag_name = $flag_row['flag_name'];
		$flag_image = $flag_row['flag_image'];
		$selected = ( $user_flag == $flag_image ) ? ' selected="selected"' : '';
		$flag_select .= '&nbsp;&nbsp;&nbsp;<option value="' . $flag_image . '"' . $selected . '">' . $flag_name . '</option>';
		if ( isset( $user_flag) && ($user_flag == $flag_image))
		{
			$flag_start_image = $flag_image;
		}
	}
	$flag_select .= '</select>';
#
#-----[ M ]------------------------------------------ 
#
		'LOCATION' => $location,
#
#-----[ , [W ]------------------------------------------ 
#
		'L_FLAG' => $lang['Country_flag'],	// Country/Location Flags
		'FLAG_SELECT' => $flag_select,		// Country/Location Flags
		'FLAG_START' => $flag_start_image,	// Country/Location Flags
# 
#-----[ } ]------------------------------------------ 
# 
includes/usercp_avatar.php
#
#-----[ M ]------------------------------------------ 
#
function display_avatar_gallery($mode,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
&$location,
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 &$user_flag,
#
#-----[ M ]------------------------------------------ 
#
	$params = array(
#
#-----[ bӦ椺M ]------------------------------------------ 
#
'location',
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 'user_flag',
# 
#-----[ } ]------------------------------------------ 
# 
viewtopic.php
#
#-----[ M ]------------------------------------------ 
#
$sql = "SELECT u.username,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
u.user_from,
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 u.user_from_flag,
#
#-----[ M ]------------------------------------------ 
#
	$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';
#
#-----[ , [W ]------------------------------------------ 
#
	// Country/Location Flags
	$poster_from_flag = ( $postrow[$i]['user_from_flag'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? '<br /><img src="images/flags/' . $postrow[$i]['user_from_flag'] . '" alt="' . $postrow[$i]['user_from_flag'] . '" border="1" /><br />' : '';
#
#-----[ M ]------------------------------------------ 
#
		'POSTER_FROM' => $poster_from,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
$poster_from
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 . $poster_from_flag
# 
#-----[ } ]------------------------------------------ 
# 
memberlist.php
#
#-----[ M ]------------------------------------------ 
#
$sql = "SELECT username,
#
#-----[ bӦ椺M ]------------------------------------------ 
#
user_from,
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 user_from_flag,
#
#-----[ M ]------------------------------------------ 
#
		$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;';
#
#-----[ N ]------------------------------------------ 
#
		$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '';
		// Country/Location Flags
		$from = ( !empty($row['user_from_flag']) ) ? $from . '&nbsp;<img src="images/flags/' . $row['user_from_flag'] . '" alt="' . $row['user_from_flag'] . '" border="1" />' : $from;
#
#-----[ } ]------------------------------------------
#
admin/admin_users.php
#
#-----[ M ]------------------------------------------ 
#
		$user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone'];
#
#-----[ , [W ]------------------------------------------ 
#
		$user_flag = ( !empty($HTTP_POST_VARS['user_flag']) && $HTTP_POST_VARS['user_flag'] != 'blank.gif' ) ? htmlspecialchars($HTTP_POST_VARS['user_flag']) : '' ;	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
#
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql
#
#-----[ bӦ椺M ]------------------------------------------ 
#
user_from = '" . str_replace("\'", "''", $location) . "',
#
#-----[ bӦ, [W ]------------------------------------------ 
#
 user_from_flag = '" . str_replace("\'", "''", $user_flag) . "',
#
#-----[ M ]------------------------------------------ 
#
			$location = htmlspecialchars(stripslashes($location));
#
#-----[ , [W ]------------------------------------------ 
#
			$user_flag = htmlspecialchars(stripslashes($user_flag));	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
#
		$location = htmlspecialchars($this_userdata['user_from']);
#
#-----[ , [W ]------------------------------------------ 
#
		$user_flag = htmlspecialchars($this_userdata['user_from_flag']);	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
#
			$s_hidden_fields .= '<input type="hidden" name="location" value="' . str_replace("\"", "&quot;", $location) . '" />';
#
#-----[ , [W ]------------------------------------------ 
#
			$s_hidden_fields .= '<input type="hidden" name="user_flag" value="' . str_replace("\"", "&quot;", $user_flag) . '" />';	// Country/Location Flags
#
#-----[ M ]------------------------------------------ 
#
		$form_enctype = ( !@$ini_val('file_uploads')
#
#-----[ , [W ]------------------------------------------ 
#
		// Country/Location Flags
		// Query to get the list of flags
		$sql = "SELECT *
			FROM " . FLAG_TABLE . "
			ORDER BY flag_name";
		if(!$flags_result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, "Couldn't obtain flags information.", "", __LINE__, __FILE__, $sql);
		}

		// Build the html select statement
		$flag_start_image = 'blank.gif';
		$flag_select = '<select name="user_flag" onChange="document.images[\'user_flag\'].src = \'../images/flags/\' + this.value;">';
		$flag_select .= '<option value="blank.gif">' . $lang['Select_country'] . '</option>';
		while ( $flag_row = $db->sql_fetchrow($flags_result) )
		{
			$flag_name = $flag_row['flag_name'];
			$flag_image = $flag_row['flag_image'];
			$selected = ( $user_flag == $flag_image ) ? ' selected="selected"' : '';
			$flag_select .= '&nbsp;&nbsp;&nbsp;<option value="' . $flag_image . '"' . $selected . '">' . $flag_name . '</option>';
			if ( isset( $user_flag) && ($user_flag == $flag_image))
			{
				$flag_start_image = $flag_image;
			}
		}
		$flag_select .= '</select>';
#
#-----[ M ]------------------------------------------ 
#
			'LOCATION' => $location,
#
#-----[ , [W ]------------------------------------------ 
#
			'L_FLAG' => $lang['Country_flag'],	// Country/Location Flags
			'FLAG_SELECT' => $flag_select,		// Country/Location Flags
			'FLAG_START' => $flag_start_image,	// Country/Location Flags
# 
#-----[ } ]------------------------------------------ 
# 
language/lang_chinese_traditional_taiwan/lang_main.php
# 
#-----[ M ]------------------------------------------ 
#
?>
# 
#-----[ e, [W ]------------------------------------------ 
# 
$lang['Country_flag'] = 'Xm';			// Country/Location Flags
$lang['Select_country'] = 'ܰaΦa';	// Country/Location Flags
# 
#-----[ } ]------------------------------------------ 
# 
language/lang_chinese_traditional_taiwan/lang_admin.php
# 
#-----[ M ]------------------------------------------ 
#
?>
# 
#-----[ e, [W ]------------------------------------------ 
# 
// Country/Location Flags
$lang['Flags'] = 'Xm';
$lang['Flags_title'] = 'Xm޲z';
$lang['Flags_explain'] = 'boӿﶵ, ziHsW, s, [ݩάORXm. A]iHۻsXmåBϥη|޲zӽs|Xm]w.';
$lang['Add_new_flag'] = 'W[@ӷsXm';
$lang['Flag_name'] = 'XmW';
$lang['Flag_pic'] = 'ϥ';
$lang['Flag_image'] = 'Xm (b images/flags/ ؿ)';
$lang['Flag_image_explain'] = 'ϥγoөwqXmϥܪ|';
$lang['Must_select_flag'] = 'zܤ@ӺXm';
$lang['Flag_updated'] = 'Xmwgs';
$lang['Flag_added'] = 'sXmwg\[J';
$lang['Flag_removed'] = 'XmwQQ';
$lang['No_update_flags'] = 'XmwQQ. OϥΦXm|]wèS@_s. ]AʭmoǷ|]w';
$lang['Flag_confirm'] = 'RXm';
$lang['Confirm_delete_flag'] = 'zTwnRoӺXm?';
$lang['Click_return_flagadmin'] = 'I %so%s ^Xm޲z';
# 
#-----[ } ]------------------------------------------ 
# 
templates/subSilver/profile_add_body.tpl
#
#-----[ M ]------------------------------------------ 
#
		<input type="text" class="post" style="width: 200px"  name="location" size="25" maxlength="100" value="{LOCATION}" />
	  </td>
	</tr>
#
#-----[ , [W ]------------------------------------------ 
#
	<tr>
	  <td class="row1"><span class="gen">{L_FLAG}:</span></td>
	  <td class="row2"><span class="gensmall">
		<table><tr>
			<td>{FLAG_SELECT}&nbsp;&nbsp;&nbsp;</td>
	  		<td><img src="images/flags/{FLAG_START}" name="user_flag" /></td>
		</tr></table>
	  </span></td>
	</tr>
#
#-----[ } ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ M ]------------------------------------------ 
#
		<input class="post" type="text" name="location" size="35" maxlength="100" value="{LOCATION}" />
	  </td>
	</tr>
#
#-----[ , [W ]------------------------------------------ 
#
	<tr>
	  <td class="row1"><span class="gen">{L_FLAG}:</span></td>
	  <td class="row2"><span class="gensmall">
		<table><tr>
			<td>{FLAG_SELECT}&nbsp;&nbsp;&nbsp;</td>
	  		<td><img src="../images/flags/{FLAG_START}" name="user_flag" /></td>
		</tr></table>
	  </span></td>
	</tr>
# 
#-----[ xs/Ҧɮ ]------------------------------------------ 
# 
# ~ץ